package 设计模式.结构型模式.Flyweight;

/**
 * @Author: kirito
 * @Date: 2024/3/13 21:15
 * @Description:
 */

public class Client {
    public static void main(String[] args) {
        AbstractBox box1 = BoxFactory.getInstance().getBox("I");
        box1.display("灰色");

        AbstractBox box2 = BoxFactory.getInstance().getBox("L");
        box2.display("绿色");

        AbstractBox box3 = BoxFactory.getInstance().getBox("O");
        box3.display("蓝色");

        AbstractBox box4 = BoxFactory.getInstance().getBox("O");
        box4.display("红色");

        System.out.println(box2 == box4);
    }
}
